<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div.container {
            height: 500px;
            width: 500px;
            margin: auto;
        }
        div.form{
            width: 150px;
            height: 150px;
            margin: 100px auto;
        }
    </style>
</head>
<body>
<div class="container">
        <form class="layui-form" action="{:url('login')}" method="post">
           <div class="form">
               <div class="layui-form-item">
                   <label class="layui-form-label">用户名</label>
                   <div class="layui-input-block">
                       <input type="text" name="mobile" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                   </div>
               </div>
               <div class="layui-form-item">
                   <label class="layui-form-label">密码框</label>
                   <div class="layui-input-inline">
                       <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                   </div>
               </div>

               <div class="layui-form-item">
                   <div class="layui-input-block">
                       <button class="layui-btn" lay-submit lay-filter="login">立即登录</button>
                       <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                   </div>
               </div>
           </div>
        </form>
</div>


</body>
<script src="__static__layui/layui.all.js"></script>
<script>
    //Demo
    layui.use('form', function(){
        const form = layui.form;

        //监听提交
        form.on('submit(login)', function(data){
            // layer.msg(JSON.stringify(data.field));
            // console.log(data);
        });
    });
</script>


</html>